package cn.demomaster.quickrouter.util;

import android.app.Activity;
import android.content.Context;
import android.os.Build;

public class ActivityUtil {
    public static boolean isActivityDestroyed(Context context) {
        if (context instanceof Activity) {
            Activity activity = (Activity) context;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                return activity.isFinishing() || activity.isDestroyed();
            } else {
                return activity.isFinishing();
            }
        }
        return false;
    }
}
